<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
		<meta http-equiv="X-UA-Compatible" content="ie=edge">
		<title>待入账页面</title>
		<link rel="stylesheet" href="../css/common.css">
		<link rel="stylesheet" href="../css/page.css">
		<script src="../js/jquery-3.2.1.min.js"></script>
		<script src="../js/media.js"></script>
		<script src="../js/public.js"></script>
		<script src="../js/common.js"></script>
		<style type="text/css">
			.heard{
				width: 100%;
				/*height: 0.84rem;*/
				box-sizing: border-box;
				padding: 0.16rem;
				background: #FFF;
				border-bottom: 0.01rem solid #DCDCDC;
			}
			.name{
				font-size: 0.16rem;
				color: #333333;
			}
			.cen{
				margin-top: 0.25rem;
			}
			.cen span{
				float: left;
				color: #666;
				font-size: 0.12rem;
			}
			.cen .time{
				float: right;
			}
			.overflowhideen{
				display: block;
				white-space: nowrap;
				overflow: hidden;
				text-overflow: ellipsis;
			}
			.order_num{
				font-size: 0.12rem;
				color: #666;
				float: right;
			}
			.order_p{
				margin-top: 0.12rem;
			}
		</style>
	</head>
	<body>
		<ul>
			
			<li class="heard clearfix repeat" style="display: none;">
				<span class="overflowhideen name">嘿嘿嘿</span>
				<div class="cen clearfix">
					<span class="money_num">成交金额：2250</span>
					<span class="time">到账时间：2017-08-30</span>
				</div>
				<p class="clearfix order_p"><span class="order_num">订单编号：1000001155020807</span></p>
			</li>
			
		</ul>
	</body>
	<script>
		$(function() {
			$.ajax({
				url: base_url + 'ZITAOHUI/store/selectBillTime',
				data: {
					store_id : sessionStorage.s_id
				},
				success: function(data) {
					//console.log(data.extend.result);
					if(data.extend.data.length == 0){
						console.log('暂无数据');
						$('.heard').hide();
						$('<li style = "text-align:center;height:0.36rem;line-height:0.36rem;">暂无数据</li>').appendTo($("ul"));
					}else{
						
						for (var i = 0; i < data.extend.data.length; i++) {
							var clone = $('.repeat').eq(0).clone();
							clone.find('.name').text(data.extend.data[i].produce_title);
							clone.find('.money_num').text('成交金额：'+data.extend.data[i].order_total_price);
							if(data.extend.data[i].order_Msg=="已结束"){
								clone.find('.time').text("到账时间："+"已到账");
							}else{
								clone.find('.time').text("到账时间："+changeTime1(data.extend.data[i].bill_time,'all'));
							}
							clone.find(".order_num").text("订单编号："+data.extend.data[i].order_num);
							clone.show().appendTo($('ul'));
						}
						
					}
				}
			})
			function changeTime1(shijian,date1) { //把传进来的毫秒数装换成字符串类型然后输出,如果不传或者time怎返回具体时间,date怎返回日期,all返回全部的日期时间
				var show = new Date(Number(shijian));
				var year = show.getFullYear();
				var month = (show.getMonth() + 1) < 10 ? '0' + (show.getMonth() + 1) : show.getMonth() + 1
				var day = show.getDate() < 10 ? '0' + show.getDate() : show.getDate();
				var hour = show.getHours() < 10 ? '0' + show.getHours() : show.getHours();
				var minutes = show.getMinutes() < 10 ? '0' + show.getMinutes() : show.getMinutes();
				var seconds = show.getSeconds() < 10 ? '0' + show.getSeconds() : show.getSeconds();
				var stringdata =  hour + ':' + minutes + ':' + seconds + ' ';
				var stringdata2 = year+'-'+month+'-'+day+' '+hour + ':' + minutes + ':' + seconds;
				var stringdata3 = year+'-'+month+'-'+day;
				if(date1==''||date1==undefined||date1==null||date1=='time'){
					return stringdata
				}else if(date1=='all'){
					return stringdata2;
				}else if(date1=='date'){
					return stringdata3;
				}else{
					return '请检查你的第二个参数,O(∩_∩)O谢谢!';
				}
			}
			
		})
	</script>
</html>